/*
 * Copyright (C) 2013 National University of Defense Technology(NUDT) & Kylin Ltd.
 *
 * Authors:
 *  Kobe Lee   kobe24_lixiang@126.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 3.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __ACTIVATION_DBUS_H__
#define __ACTIVATION_DBUS_H__

#include <glib-object.h>
#include <glib.h>
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <polkit/polkit.h>

G_BEGIN_DECLS

#define ACTIVATION_DBUS_NAME	"org.freedesktop.activation"
#define ACTIVATION_DBUS_PATH	"/org/freedesktop/activation"
#define ACTIVATION_DBUS_INTERFACE	"org.freedesktop.activation.interface"
#define ACTIVATION_DBUS_ACTION_ID	"org.freedesktop.activation.authentication"
#define ACTIVATION_TYPE_DBUS	(activation_dbus_get_type())

#define ACTIVATION_DBUS(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), ACTIVATION_TYPE_DBUS, ActivationDbus))
#define ACTIVATION_DBUS_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), ACTIVATION_TYPE_DBUS, ActivationDbusClass))
#define ACTIVATION_IS_DBUS(o)	(G_TYPE_CHECK_INSTANCE_TYPE((o), ACTIVATION_TYPE_DBUS))
#define ACTIVATION_IS_DBUS_CLASS(k)	(G_TYPE_CHECK_CLASS_TPYE((k), ACTIVATION_TYPE_DBUS))
#define ACTIVATION_DBUS_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS((o), ACTIVATION_TYPE_DBUS, ActivationClass))

typedef struct _ActivationDbusPrivate ActivationDbusPrivate;
typedef struct _ActivationDbus ActivationDbus;
typedef struct _ActivationDbusClass ActivationDbusClass;


struct _ActivationDbus {
	GObject parent;
    ActivationDbusPrivate *priv;
};

struct _ActivationDbusClass {
	GObjectClass parent_class;
	/* signals */
    void (*event)(ActivationDbus* dbus, guint type, GValue * value);
	
};



GType activation_dbus_get_type(void);
ActivationDbus * activation_dbus_new(void);

gint activation_dbus_work(ActivationDbus * dbus, gchar * path, DBusGMethodInvocation * ret_value);
gint activation_dbus_exit(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_serial_number(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_register_number(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_qrcode(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_activate(ActivationDbus * dbus, gchar * code, DBusGMethodInvocation * ret_value);
gint activation_dbus_date(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_status(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_trial_status(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_can_set_serial(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_new_register_number(ActivationDbus * dbus, gchar * code, DBusGMethodInvocation * ret_value);
gint activation_dbus_new_qrcode(ActivationDbus * dbus, gchar * code, DBusGMethodInvocation * ret_value);
gint activation_dbus_new_activate(ActivationDbus * dbus, gchar * serial, gchar * code, DBusGMethodInvocation * ret_value);
gint activation_dbus_get_customer(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_get_encrypted_hardware_info(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_get_harddisk_id(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_get_interface_mac(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_get_system_uuid(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_set_customer(ActivationDbus * dbus, gchar * customer, DBusGMethodInvocation * ret_value);
gboolean activation_dbus_import_auth_file(ActivationDbus * dbus, gchar * path, DBusGMethodInvocation * ret_value);
gboolean activation_dbus_remove_activation_file(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gboolean activation_dbus_remove_license_file(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_get_service_tag(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_get_vendor(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_get_model(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_check_oem(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_license_check(ActivationDbus * dbus, gchar * l_file, gchar * i_file, DBusGMethodInvocation * ret_value);
gint activation_dbus_trial_date(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);
gint activation_dbus_find_ukey(ActivationDbus * dbus, DBusGMethodInvocation * ret_value);

//void activation_dbus_emit_activation_result(ActivationDbus * dbus,gint ret);
G_END_DECLS

int dbus_init(void);

#endif

